<template>
  <box-page v-if="page" v-bind="page"></box-page>
</template>

<script>
// @ is an alias to /src
import boxPage from "@/components/boxPage.vue"
import panelPage from "@/components/panel.vue"
import {getPageData} from "@/util/util"
export default {
  name: "Pages",
  components:{boxPage,panelPage},
  data:() => ({page:undefined,loadData:{}}),
  computed:{
    name(){
      return this.$route.params.name;
    }
  },
  methods:{
    async initPage(){
      const n = this.name;
      const d = await getPageData(n);
      this.page = d;
    },
  },
  created(){
    this.initPage();
  }
};
</script>
